import request from '@/utils/request'

// 创建仓库
export function createWarehouse(data) {
  return request({
    url: '/wms/warehouse/create',
    method: 'post',
    data: data
  })
}

// 更新仓库
export function updateWarehouse(data) {
  return request({
    url: '/wms/warehouse/update',
    method: 'put',
    data: data
  })
}

// 删除仓库
export function deleteWarehouse(id) {
  return request({
    url: '/wms/warehouse/delete?id=' + id,
    method: 'delete'
  })
}

// 获得仓库
export function getWarehouse(id) {
  return request({
    url: '/wms/warehouse/get?id=' + id,
    method: 'get'
  })
}

// 获得仓库简单列表
export function getWarehouseSimple() {
  return request({
    url: '/wms/warehouse/list-all-simple',
    method: 'get'
  })
}

// 获得仓库分页
export function getWarehousePage(query) {
  return request({
    url: '/wms/warehouse/page',
    method: 'get',
    params: query
  })
}

// 导出仓库 Excel
export function exportWarehouseExcel(query) {
  return request({
    url: '/wms/warehouse/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
